import requests


def main():
        
    url = "https://qianfan.baidubce.com/v2/app/conversation/file/upload"
    
    payload = {
        'app_id': '8e6261af-1425-43cb-be2c-f6a572c5419c'
    }
    files=[
        ('file',('课堂图片.jpg',open('C:\\fakepath\\课堂图片.jpg','rb'),'image/jpeg'))
    ]
    headers = {
        'X-Appbuilder-Authorization': 'Bearer bce-v3/ALTAK-uActZcRDqp7vszvgMXCmT/00537916b888bc8dde87c88e074fdbb39d90d05d'
    }
    
    response = requests.request("POST", url, headers=headers, data=payload, files=files)
    
    print(response.text)
    

if __name__ == '__main__':
    main()
